import { type ActiveInfo } from '@/types/homeTable.ts';
export default () => {
  const activeBlock = ref('');
  const activeBlockMarket = ref('');
  const defaultActiveInfo = { rank: 0, rankChange: 0 };
  const activeInfoArr = ref<ActiveInfo[]>(new Array(3).fill(defaultActiveInfo));
  const initActiveBlock = () => {
    activeBlock.value = '';
    activeInfoArr.value = new Array(3).fill(defaultActiveInfo);
  };
  const setActiveBlock = ({ code, market }: { code: string; market: string }) => {
    activeBlock.value = code;
    activeBlockMarket.value = market;
  };
  return {
    activeBlock,
    activeBlockMarket,
    activeInfoArr,
    initActiveBlock,
    setActiveBlock
  };
};
